package org.dtrd.modules.service.entity.po;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Getter;
import lombok.Setter;
import org.dtrd.modules.service.entity.bean.ServiceCategoryInfo;

import java.util.Date;


/**
 * <p>
 * 服务套餐分类信息
 * </p>
 *
 * @author QR
 * @since 2021-11-19 18:52:54
 */
@Getter
@Setter
@TableName("dtrd_ent_rd_service_category")
public class DtrdEntRdServiceCategory {

    @TableId(value = "data_id", type = IdType.AUTO)
    private Integer dataId;

    /**
     * 分类名称
     */
    @TableField(value = "category_name")
    private String categoryName;

    /**
     * 分类图片链接
     */
    @TableField(value = "category_img")
    private String categoryImg;

    /**
     * 分类描述
     */
    @TableField(value = "category_desc")
    private String categoryDesc;

    /**
     * 所属机构编码
     */
    @TableField(value = "org_code")
    private String orgCode;

    /**
     * 创建人id
     */
    @TableField(value = "create_by")
    private String createBy;

    @TableField(value = "create_time")
    private Date createTime;

    @TableField(value = "update_by")
    private String updateBy;

    @TableField(value = "update_time")
    private Date updateTime;

    @TableField(value = "is_del")
    @TableLogic
    private Integer isDel;

    public DtrdEntRdServiceCategory init() {
        isDel = 0;
        createTime = new Date();
        updateTime = new Date();
        return this;
    }

    public DtrdEntRdServiceCategory parseFromDto(ServiceCategoryInfo dto) {
        dataId = dto.getDataId();
        categoryName = dto.getCategoryName();
        categoryImg = dto.getCategoryImg();
        categoryDesc = dto.getCategoryDesc();
        orgCode = dto.getOrgCode();
        return this;
    }


}
